package com.yuefresh.sys;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuefresh.core.EntityAtomManager;

/**
 * 
 * @author yihua
 * @since 2013-03-25
 */
@Service
@Transactional
public class RoleManager extends EntityAtomManager<Role, Long> {

	public List<Role> getRoles(User user) {
		String hql = "select m.role from Membership m where m.user = ? and m.isValid = true";
		List<Role> roles = find(hql, user);
		return roles;
	}
	
}
